﻿<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/naija.Master" CodeBehind="UsersProfile.aspx.vb" Inherits="WebApplication11.UsersProfile" 
    title="Untitled Page" %>

<script runat="server">

    Protected Sub UploadButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)Handles UploadButton.Click
        If ProfileImage.HasFile = False Then
            UploadDetails.Text = "Please First Select a File to Upload"
        Else
            UploadDetails.Text = String.Format("Uploaded File: {0} <br/>""Congratulations Your Profile has been Updated <br/>" & _
                                              "Upload Size: (In Bytes):{1:N0)}<br/>" & _
                                              "Content-Type:{2}", ProfileImage.FileName, ProfileImage.FileBytes.Length, ProfileImage.PostedFile.ContentType)
            
            Image1.ImageUrl = "UserImages/" & User.Identity.Name & ".jpg"
        End If
    End Sub
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 49%;
        }
        .style2
        {
            width: 420px;
        }
        .style3
        {
            width: 758px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <p>
        Hello,
        <asp:LoginName ID="LoginName1" runat="server" ForeColor="#FF0066" />
                        !</p>
                        <h2 style="font-family: Candara; font-size: large; color: #FF0066;  width: 470px; height: 20px;" 
                            align="center">
                            User&#39;s Profile</h2> 
                        <table class="style1" bgcolor="#FFCCFF">
                            <tr>
                                <td class="style2">
                                    First Name:</td>
            <td class="style3">
                <asp:TextBox ID="FirstName" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Last Name:</td>
            <td class="style3">
                <asp:TextBox ID="LastName" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Gender:</td>
            <td class="style3">
                <asp:RadioButtonList ID="Gender" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem>Male</asp:ListItem>
                    <asp:ListItem>Female</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Company Name:</td>
            <td class="style3">
                <asp:TextBox ID="Company" runat="server" Width="297px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Location:</td>
            <td class="style3">
                <asp:TextBox ID="Location" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Picture:<br />
            </td>
            <td class="style3">
                <asp:FileUpload ID="ProfileImage" runat="server" />
               
            </td>
        </tr>
    </table>
    <div > 
    <asp:Button ID="UploadButton" runat="server" BackColor="#FF0066" 
                    BorderColor="#FF33CC" Height="23px" Text="Submit" Width="159px" 
                    ForeColor="White" onclick="UploadButton_Click" /> <br />
                
        <asp:PlaceHolder ID="PlaceHolder1" runat="server"> <asp:Image ID="Image1" runat="server" /></asp:PlaceHolder>
        <br />
        <asp:Label ID="UploadDetails" runat="server"></asp:Label>
        <br />
        
    </div>
</asp:Content>
